import {Util} from "/components.pl/components-util.js";
export class GroupbuyModule extends Polymer.Element {
    
    static get template() {
        return Polymer.html `
        <style>
            :host{
                font-size:13px;
                --paper-font-subhead_-_font-size:14px;
            }
            .box{box-shadow:0px 0px 5px #888;padding:10px;position:relative;}
            h3{ 
                background: #fff;
                height:41px;
                text-align:center;
                font-size:15px;
                padding:0px;
                margin:0px;
                line-height:41px;
                font-size: 20px;
                text-align: right;
            }
            .price{
                position: absolute;
                top: 10px;
                left: 55px;
                height: 41px;
                background: #000;
                color: #fff;
                line-height: 40px;
                width: 70px;
                font-size: 18px;
                text-align: center;
                border-radius: 3px;
                font-weight: bold;
            }
            .top{
                text-align:center;
                padding:10px 0px;
                line-height: 30px;
                font-size:12px;
                border-bottom:#eee solid 1px;
            }
            .top>div:first-of-type{font-size: 15px;}
            .my{padding:10px 0px;display:flex;justify-content: space-between;align-items:center;border-bottom:#eee solid 1px;}
            .my .term{font-size:10px;align-items: center;}
            .bottom{
                display:grid;
                grid-template-columns:repeat(10,1fr);
                grid-gap: 1px;
                padding-top:10px;
            }
            .bottom>*{
                background-size:contain;
                width:100%;
            }
            iron-image{width:100%;height:100%;}
            .btn_join{background-color:#cc0033;color:#fff;}
            paper-button{margin:0px;}
            *[secondary]{font-size:12px;color:#666}
            .middle div[secondary]{display:flex;justify-content: space-between;}
            *[hidden]{display:none}
        </style>
        <iron-ajax id="xhr_setting_get" url="{{context.pluginPath}}bin/setting-get.py?moduleId={{id}}" last-response="{{config}}"></iron-ajax>
        <iron-ajax id="xhr_product_get" url="/plugin/api/product.get" on-last-response-changed="_productChanged"></iron-ajax>
        <template is="dom-if" if="{{!context.product}}">
            <div style="text-align:center;background:#eee;padding:20px;">
                <strong>规则未配置，无法展示拼团信息。</strong>
            </div>
        </template>
        <template is="dom-if" if="{{context.product}}">
            <div class="box">
                <h3>拼团价</h3>
                    <svg viewBox="0 0 512 512" style="height: 65px;position: absolute;top: -2px;">
                        <g>
                            <path d="M92.164,186.126c-7.384,0-11.67,3.573-11.67,11.433v33.824c0,7.861,4.287,11.433,11.67,11.433    c7.385,0,11.911-3.573,11.911-11.433V197.56C104.075,189.699,99.549,186.126,92.164,186.126z"/>
                        </g>

                        <g>
                            <path d="M201.498,262.825c-7.384,0-11.671,3.573-11.671,11.433v33.824c0,7.86,4.289,11.433,11.671,11.433    s11.91-3.573,11.91-11.433v-33.824C213.407,266.399,208.882,262.825,201.498,262.825z"/>
                        </g>

                        <g>
                            <path d="M496.607,94.801H337.077l-0.736,0.736l13.112,13.112c10.517,10.517,10.517,27.63,0,38.147l-13.112,13.112l13.112,13.112    c10.517,10.517,10.517,27.63,0,38.147l-13.112,13.112l13.112,13.112c10.517,10.517,10.517,27.63,0,38.147l-13.112,13.112    l13.112,13.112c10.517,10.517,10.517,27.63,0,38.147l-13.112,13.112l13.112,13.112c5.096,5.094,7.901,11.868,7.901,19.073    c0,7.206-2.806,13.98-7.901,19.074l-12.919,12.92h160.072c8.501,0,15.393-6.892,15.393-15.393V110.195    C512,101.693,505.108,94.801,496.607,94.801z"/>
                        </g>

                        <g>
                            <path d="M321.306,192.095l-13.112-13.112c-5.096-5.094-7.901-11.868-7.901-19.073c0-7.206,2.806-13.98,7.901-19.074l13.112-13.112    l-13.112-13.112c-5.445-5.445-8.046-12.658-7.853-19.809H15.393C6.892,94.801,0,101.693,0,110.195v291.611    c0,8.501,6.892,15.393,15.393,15.393h284.905c0.049-7.132,2.846-13.832,7.896-18.881l13.112-13.112l-13.112-13.112    c-10.517-10.517-10.517-27.63,0-38.147l13.112-13.112l-13.112-13.112c-10.517-10.517-10.517-27.63,0-38.147l13.112-13.112    l-13.112-13.112c-10.517-10.517-10.517-27.63,0-38.147L321.306,192.095z M56.436,231.384V197.56    c0-23.581,15.484-32.157,35.73-32.157c20.009,0,35.731,8.576,35.731,32.157v33.824c0,23.582-15.722,32.157-35.731,32.157    C71.919,263.54,56.436,254.965,56.436,231.384z M106.219,350.482c-8.099,0-13.339-6.669-13.339-12.624    c0-1.429,0.476-3.096,1.191-4.526l83.606-171.739c1.906-4.049,5.717-5.955,10.004-5.955c6.669,0,14.053,5.002,14.053,12.624    c0,1.429-0.238,3.096-0.952,4.526l-83.846,171.739C115.27,348.1,110.744,350.482,106.219,350.482z M237.226,308.083    c0,23.582-15.721,32.157-35.73,32.157c-20.246,0-35.73-8.575-35.73-32.157v-33.824c0-23.582,15.482-32.157,35.73-32.157    c20.009,0,35.73,8.575,35.73,32.157V308.083z"/>
                        </g>
                    </svg>
                <div class="price">￥{{config.price}}</div>
                <template is="dom-if" if="{{config.pic_small}}">
                    <paper-icon-item style="padding:0px;border-bottom:#eee solid 1px;">
                        <a href="{{context.rootPath}}product-detail/{{context.product.id}}">
                            <iron-image sizing="cover" slot="item-icon" width="50" height="50" src="{{context.product.album.0}}?imageView2/5/w/70/h/70"></iron-image>
                        </a>
                        <paper-item-body two-line>
                            <div>{{context.product.name}}</div>
                            <div secondary>原价：{{_price(context.product)}}</div>
                        </paper-item-body>
                        <paper-button class="btn_join">邀请好友拼团</paper-button>
                    </paper-icon-item>
                </template>
                <template is="dom-if" if="{{config.pic_middle}}">
                    <div class="middle" style="padding:10px 0px;border-bottom:#eee solid 1px;display:flex;justify-content: space-between;align-items: center;background-color:#f5f5f5;background-clip: content-box;">
                        <a href="{{context.rootPath}}product-detail/{{context.product.id}}">
                            <img style="width:60%;object-fit: contain;display:block;" src="{{context.product.album.0}}?imageView2/5/w/450/h/450"/>
                        </a>
                        <div  style="width:40%;padding:10px;line-height:20px;">
                            <div>{{context.product.name}}</div>
                            <div secondary>原价：<s>{{_price(context.product)}}</s></div>
                            <div secondary>拼团价：<span>{{_money(config.price)}}</span></div>
                            <paper-button class="btn_join" style="width:100%;line-height: initial;margin-top:10px;">邀请好友拼团</paper-button>
                        </div>
                    </div>
                </template>
                <template is="dom-if" if="{{config.pic_big}}">
                    <div style="padding:10px 0px;border-bottom:#eee solid 1px;">
                        <a href="{{context.rootPath}}product-detail/{{context.product.id}}">
                            <img style="width:100%;object-fit: contain;display:block;" src="{{context.product.album.0}}?imageView2/5/w/750/h/750"/>
                        </a>
                        <div  style="display:flex;justify-content: space-between;align-items: center;padding:10px 0px;">
                            <div>{{context.product.name}}</div>
                            <div secondary>原价：{{_price(context.product)}}</div>
                        </div>
                        <paper-button class="btn_join" on-click="_share" style="width:100%;line-height: initial;">邀请好友拼团</paper-button>
                    </div>
                </template>
                
                <div class="top">
                    <div>{{remainingTime}}</div>
                    <div>共<span>15</span>个团队，<span secondary class="members">1225</span>人已参加</div>
                </div>
                <div hidden$="{{!started}}" class="my"><strong>我的拼团</strong><span secondary class="term">还差13人</span></div>
                <div hidden$="{{!started}}" class="bottom" id="answers">
                <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" style="transform-origin: 50px 50px 0px;" xml:space="preserve"><g style="transform-origin: 50px 50px 0px;"><g style="transform-origin: 50px 50px 0px; transform: scale(1);"><g style="transform-origin: 50px 50px 0px;"><g><g class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -1s; animation-direction: normal;"><path style="fill: none; stroke: rgb(204, 0, 51); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 10;" d=" M62.82,41.263l0.162-2.666c-0.015-0.462-0.178-0.901-0.458-1.235l-4.301-5.127c-0.314-0.374-0.749-0.586-1.203-0.586h-2.562 c-0.648,0-1.173-0.597-1.173-1.333v-2.098c1.475-0.794,2.498-2.497,2.498-4.475v-5.057c0-2.712-1.934-4.911-4.32-4.911h-2.925 c-2.386,0-4.32,2.199-4.32,4.911v5.057c0,1.979,1.023,3.681,2.498,4.475v2.098c0,0.736-0.525,1.333-1.173,1.333H42.98 c-0.455,0-0.889,0.212-1.203,0.586l-4.301,5.127c-0.28,0.334-0.443,0.774-0.458,1.235l0.162,2.666" stroke="#cc0033"></path></g><g class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.933333s; animation-direction: normal;"><path style="fill: none; stroke: rgb(204, 0, 51); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 10;" d=" M62.82,86.225l0.162-2.666c-0.015-0.462-0.178-0.901-0.458-1.235l-4.301-5.127c-0.314-0.374-0.749-0.586-1.203-0.586h-2.562 c-0.648,0-1.173-0.597-1.173-1.333V73.18c1.475-0.794,2.498-2.497,2.498-4.475v-5.057c0-2.712-1.934-4.911-4.32-4.911h-2.925 c-2.386,0-4.32,2.199-4.32,4.911v5.057c0,1.979,1.023,3.681,2.498,4.475v2.098c0,0.736-0.525,1.333-1.173,1.333H42.98 c-0.455,0-0.889,0.212-1.203,0.586l-4.301,5.127c-0.28,0.334-0.443,0.774-0.458,1.235l0.162,2.666" stroke="#cc0033"></path></g><g class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.866667s; animation-direction: normal;"><path style="fill: none; stroke: rgb(204, 0, 51); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 10;" d=" M30.802,86.225l0.162-2.666c-0.015-0.462-0.178-0.901-0.458-1.235l-4.301-5.127c-0.314-0.374-0.749-0.586-1.203-0.586h-2.562 c-0.648,0-1.173-0.597-1.173-1.333V73.18c1.475-0.794,2.498-2.497,2.498-4.475v-5.057c0-2.712-1.934-4.911-4.32-4.911h-2.925 c-2.386,0-4.32,2.199-4.32,4.911v5.057c0,1.979,1.023,3.681,2.498,4.475v2.098c0,0.736-0.525,1.333-1.173,1.333h-2.562 c-0.455,0-0.889,0.212-1.203,0.586l-4.301,5.127C5.178,82.658,5.015,83.098,5,83.559l0.162,2.666" stroke="#cc0033"></path></g><g class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.8s; animation-direction: normal;"><path style="fill: none; stroke: rgb(204, 0, 51); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 10;" d=" M94.838,86.225L95,83.559c-0.015-0.462-0.178-0.901-0.458-1.235l-4.301-5.127c-0.314-0.374-0.749-0.586-1.203-0.586h-2.562 c-0.648,0-1.173-0.597-1.173-1.333V73.18c1.475-0.794,2.498-2.497,2.498-4.475v-5.057c0-2.712-1.934-4.911-4.32-4.911h-2.925 c-2.386,0-4.32,2.199-4.32,4.911v5.057c0,1.979,1.023,3.681,2.498,4.475v2.098c0,0.736-0.525,1.333-1.173,1.333h-2.562 c-0.455,0-0.889,0.212-1.203,0.586l-4.301,5.127c-0.28,0.334-0.443,0.774-0.458,1.235l0.162,2.666" stroke="#cc0033"></path></g><g class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.733333s; animation-direction: normal;"><polyline style="fill: none; stroke: rgb(204, 0, 51); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 10;" points=" 17.982,53.536 17.982,48.467 82.018,48.467 82.018,53.536 " stroke="#cc0033"></polyline></g><g class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.666667s; animation-direction: normal;"><line style="fill: none; stroke: rgb(204, 0, 51); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-miterlimit: 10;" x1="50" y1="43.131" x2="50" y2="53.536" stroke="#cc0033"></line></g><metadata xmlns:d="https://loading.io/stock/" class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.6s; animation-direction: normal;">
                <d:name class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.533333s; animation-direction: normal;">hierarchy</d:name>
                <d:tags class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.466667s; animation-direction: normal;">hierarchy,corporate,enterprise,manage,team,organization,supervise,mentor</d:tags>
                <d:license class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.4s; animation-direction: normal;">cc-by</d:license>
                <d:slug class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.333333s; animation-direction: normal;">o7r0ge</d:slug>
                </metadata></g></g></g></g><style type="text/css" class="ld ld-fade" style="transform-origin: 50px 50px 0px; animation-duration: 1s; animation-delay: -0.266667s; animation-direction: normal;">path,ellipse,circle,rect,polygon,polyline,line { stroke-width: 0; }@keyframes ld-fade {
                  0% {
                    opacity: 1;
                  }
                  100% {
                    opacity: 0;
                  }
                }
                @-webkit-keyframes ld-fade {
                  0% {
                    opacity: 1;
                  }
                  100% {
                    opacity: 0;
                  }
                }
                .ld.ld-fade {
                  -webkit-animation: ld-fade 1s infinite linear;
                  animation: ld-fade 1s infinite linear;
                }
                </style></svg>
                </div>
            </div>
        </template>
    `;
    }
    static get properties(){
        return {
            id:{
                type:String,
                observer:"_idChanged"
            },
            config:{type:Object,observer:"_configChanged"},
            util:{value:new Util(),type:Object},
            visible:{type:Boolean,observer:"_visibleChanged"},
            success:{type:Boolean,value:false},
            started:{type:Boolean,value:false}
        }
    }
    ready(){
        super.ready();
    }
    _price(product){
        return this.util.price(product);
    }
    _money(price){
        return this.util.money(price);
    }
    _visibleChanged(visible){
        if(visible){
            let xhr = new XMLHttpRequest();
            xhr.responseType ="json";
            xhr.open("GET",this.context.pluginPath+"bin/my-groupbuy-status.py?account_id="+this.context.accountId+"&id="+this.id);
            xhr.addEventListener("load",e=>{
                this.started = Boolean(xhr.response.started);
                this.success = Boolean(xhr.response.success);
            });
            xhr.send(null);
            this.messageListener = this.context.websocket.addEventListener("message",e=>{
                let message = e.detail;
                console.log(message);
                if(message.type="groupbuy.share.answer"){
                    let account = message.account;
                    let img = document.createElement("img");
                    img.src = "data:image/svg+xml;%20charset=utf8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D%220%200%2024%2024%22%20%3E%3C%2Fsvg%3E";
                    img.style.backgroundImage = "url("+account.avatar_url+")";
                    this.$.answers.insertBefore(this.$.answers.lastElementChild,img);
                }
            });
        }else{
            if(this.messageListener){
                this.context.websocket.removeEventListener("message",this.messageListener);
            }
        }
    }
    _configChanged(config){
        if(config){
            if(Boolean(this.config.custom)){
                this.$.xhr_product_get.params.product_id = this.config.productId;
                this.$.xhr_product_get.generateRequest();
            }
            if(this.remainingTimeInterval){
                window.clearInterval(this.remainingTimeInterval);
            }
            let startTime = Date.parse(new Date(this.config.startTime.split(".")[0].replace(/-/g, '/').replace(/T/g, ' ')));
            let endTime = Date.parse(new Date(this.config.endTime.split(".")[0].replace(/-/g, '/').replace(/T/g, ' ')));
            this.remainingTimeInterval = window.setInterval(()=>{
                let timeNow = new Date().getTime();
                if(timeNow>startTime){
                    this.remainingTime = "距离活动结束时间："+this.util.countdown(endTime,timeNow);
                }else{
                    this.remainingTime = "距离活动开始时间："+this.util.countdown(startTime,timeNow);
                }
            },1000);
        }
    }
    _productChanged(e){
        this.context.product = e.detail.value.result;
        this.notifyPath("context.product");
    }
    _idChanged(id){
        this.$.xhr_setting_get.generateRequest();
    }
    _share(e){
        this.answerLoading = true;
        this.started = true;
        let xhr = new XMLHttpRequest();
        xhr.open("GET",this.context.pluginPath+"bin/my-groupbuy-status.py?start=1&account_id="+this.context.accountId+"&id="+this.id);
        xhr.send(null);
        wx.miniProgram.navigateTo({url:"/pages/share/share-simple?scene="+encodeURIComponent(JSON.stringify({url:this.context.pluginPath+"bin/share-open.py?inviter_token="+this.context.token+"&inviter_account_id="+this.context.accountId,imageUrl:"https://cdn.image.b2wx.com/app/1914/images/1548172629219",title:"测试",app_id:this.context.appId}))});
    }
}
window.customElements.define('groupbuy-module', GroupbuyModule);
import '/components.pl/components-product-selector.js';
export class GroupbuyModuleConfig extends Polymer.Element {
    static get properties(){
        return {
            moduleId:String,
            getType:{value:"auto"}
        }
    }
    static get template() {
        return Polymer.html `
        <style>
            :host{
                padding:10px;
                display:block;
                --paper-toast-background-color:#cc0033;
            }
            #message{
                --paper-toast-background-color: #cc0033;
                --paper-toast-color: white;
            }
            h4{margin:0px;padding:0px;line-height:30px;}
            .item{
                border-bottom:#eee solid 1px;
                padding:10px 0px;
            }
            form paper-button{
                width:100%;
                margin:0px;
                background-color:#778899;
                color:#fff;
            }
            .summary{font-size:12px;color:#666;}
        </style>
        <iron-ajax id="xhr_setting_save" method="POST" url="{{context.pluginPath}}bin/setting.py" content-type="application/json" on-response="_success" on-error="_error"></iron-ajax>
        <paper-dialog id="message" style="max-width:100%;width:100%;">
            <div>{{message}}</div>
            <div class="buttons">
                <paper-button dialog-confirm autofocus>确定</paper-button>
            </div>
        </paper-dialog>
        <iron-form id="form">
        <form>
        <input name="moduleId" value="{{moduleId}}" type="hidden"/>
        <div class="item">
            <h4>目标产品服务</h4>
            <paper-radio-group selected="{{providerType}}">
              <paper-radio-button name="auto" value="1">自动获取</paper-radio-button>
              <paper-radio-button name="custom" value="1">指定产品服务</paper-radio-button>
            </paper-radio-group>
            <iron-collapse opened="{{_equal(providerType,'auto')}}">
                <p class="summary">选择<strong>自动获取</strong>，则此插件仅在产品服务详情页时可用。如需在其它页面展示购团活动，请使用<strong>指定产品服务</strong></p>
            </iron-collapse>
            <input type="hidden" name="productId" value="{{config.productId}}"/>
            <iron-collapse opened="{{_equal(providerType,'custom')}}">
                <components-product-selector value="{{config.productId}}" context="{{context}}"></components-product-selector>
            </iron-collapse>
        </div>
        <div class="item">
            <h4>最低参团人数</h4>
            <paper-input required auto-validate name="peopleNumber" type="number" value="{{config.peopleNumber}}" no-label-float label="请输入人数">
            </paper-input>
            <p class="summary">用户邀请人数满足此处设置的数量后，拼团成功。</p>
        </div>
        <div class="item">
            <h4>拼团价格</h4>
            <paper-input required auto-validate name="price" value="{{config.price}}" type="number" no-label-float label="请输入价格">
                <label slot="prefix">￥</label>
            </paper-input>
        </div>
        <div class="item">
            <h4>活动开始时间</h4>
            <paper-input id="startTime" required type="datetime-local" on-value-changed="_startTimeChanged" value="{{config.startTime}}" label="请选择时间"></paper-input>
            <input type="hidden" name="startTime" value="{{config.startTime}}"/>
        </div>
        <div class="item">
            <h4>活动结束时间</h4>
            <paper-input id="endTime" required type="datetime-local" on-value-changed="_endTimeChanged" value="{{config.endTime}}" label="请选择时间"></paper-input>
            <input type="hidden" name="endTime" value="{{config.endTime}}"/>
        </div>
        <div class="item">
            <h4>产品图片</h4>
            <paper-radio-group selected="{{picSize}}">
                <paper-radio-button name="pic_small" value="1">小</paper-radio-button>
                <paper-radio-button name="pic_middle" value="1">中</paper-radio-button>
                <paper-radio-button name="pic_big" value="1">大</paper-radio-button>
            </paper-radio-group>
        </div>
        
        <p>
            <paper-button on-click="_save">保存</paper-button>
        </p>
        </form>
        </iron-form>
    `;
    }
    static get observers(){
        return ["_setConfig(module.config)"];
    }
    static get properties(){
        return {
            providerType:{value:"auto"},
            picSize:{value:"pic_small"},
            startTime:{value:""},
            endTime:{value:""},
            formValue:Object,
            config:Object
        }
    }
    ready(){
        super.ready();
        this.$.message.fitInto = this.$.form;
    }
    _equal(v1,v2){
        return v1==v2;
    }
    _json(){
        return [2346,2344,6352];
    }
    _setConfig(config){
        if(config){
            this.providerType = Boolean(config.custom)?"custom":"auto";
            this.picSize = Boolean(config.pic_big)?"pic_big":(Boolean(config.pic_middle)?"pic_middle":"pic_small");
        }
        this.config = config?config:{};
    }
    _save(e){
        if(this.providerType=="custom"&&!this.config.productId){
            this.message = "请至少选择一个参与团购的产品服务";
            this.$.message.open();
        }else{
            let error = false;
            let eles = this.shadowRoot.querySelectorAll("paper-input").forEach(ele=>{
                if(ele.id=="startTime"&&(ele.value==""||!ele.value)){
                    error = !ele.validate();
                }else if(ele.id=="endTime"&&(ele.value==""||!ele.value)){
                    error = !ele.validate();
                }else if(ele.id!="startTime"&&ele.id!="endTime"){
                    error = !ele.validate();
                }
            });

            if(!error){
                this.$.startTime.invalid =false;
                this.$.endTime.invalid =false;
                this.formVlaue = this.$.form.serializeForm();
                this.$.xhr_setting_save.body = this.formVlaue;
                this.$.xhr_setting_save.generateRequest();
            }
        }
    }
    _success(e){
        this.module.config = this.formVlaue;
        this.dispatchEvent(new CustomEvent("close",{detail:this.formVlaue}));
    }
    _error(e){
        this.message = e.detail.request.response.message;
        this.$.message.open();
    }
}
window.customElements.define('groupbuy-module-config', GroupbuyModuleConfig);
